logo.png

Machine Learning wstęp

Leszek FrÄ…Å›

Wprowadzenie:

1) Co to jest uczenie maszynowe

1.1) Dlaczego warto korzystać z uczenia maszynowego

2)Przykładowe zastosowania

3) Rodzaje systemów uczenia maszynowego

4) Uczenie z modelu

5) Główne Problemy Uczenia maszynowego

1. Czym jest uczenie maszynowe?

,,...Uczenie maszynowe to dziedzina nauki dająca komputerom możliwość uczenia się bez konieczności ich jawnego programowania..." Arthur Samuel, 1959

a bardziej technicznie:

Mówimy ze program komputerowy uczy się na podstawie doświadczenia E w odniesieniu do jakiegoś zadania T i pewnej miary wydajności P, jeśli jego wydajność (mierzona przez P) wobec zadania T wzrasta z nabywaniem doświadczenia E. Tom Mitchell, 1997,

1.1 Dlaczego warto korzystać z uczenia maszynowego

Schemat_1.drawio.png

Zadanie: napisać filtr spamu, przy pomocy tradydycyjnych technik programistycznych

1) Zastanowienie jak wygląda klsyczny spam - powtarzające się wyrażenia: okazja, darmowe, bonus, promocja, gratis, bez limitów. Występowanie: temat wiadomości

2) Napisanie algorytmu wykrywającego każdy z zaobserwowanych szablonów. Program oznaczałby wiadomość jako spam, jeśli wykryłby jeden z kilku określonych wzorców.

3) Testowanie programu, ciągłe powtarzanie kroków 1) i 2)

=> a co jeśli spamerzy zauważyli by blokowanie algorytmu wykrywającego nieporządane mejle?

Próby omijania filtrów: wkomponowywanie białych znaków, znaków specjalnych

=> należy nom stop uwzględniać nowe zmiany poprzez dopisywanie nowych reguł...

Najlepsze rozwiÄ…zanie?

Stworzenie samouczącego się algorytmu, na podstawie przykładów i kombinacji z nim związanych

Untitled%20Diagram.drawio.png

Wykorzystanie technik uczenia maszynowego do analizowania olbrzymich ilości danych może pomóc w wykrywaniem nieoczywistych wzorców. Proces nazywa się wydobywaniem danych (data minig)

Uczenie maszynowe nadaje siÄ™ do:

1) problemów, które wymagają częstego dsotrajania algorytmu lub korzystania z długih list reguł

2) złożonych problemów, trudnych do rozwiązania tradycyjnymi metodami

3) zmiennych środowisk wpływających na problematykę

4) pomagania człowiekowu w analizowaniu skomplikowanych zagadnień i olbrzymich ilości danych

3. Rodzaje systemów uczenia maszynowgo

In [ ]:
 
  • 3.1 Uczenie nadzorowane

=> dane są oznakowane, jest zbiór uczący oraz zbiór weryfikacyjny

In [ ]:
 

metoda k-najbliższych sąsiadów

regresja liniowa

regresja logistyczna

Maszyna wektorów nośnych

drzewa decyzyjne i losowe lasy

sieci neuronowe

In [ ]:
 
  • 3.2 Uczenie nienadzorowane

=> dane uczÄ…ce sÄ… nieoznakowane. Program uczy siÄ™ bez nauczyciela

In [ ]:
 

metoda k-średnich lub centroidów (k-means)

hierarchiczna analiza skupień (hierarchical cluster analysis, HCA)

Wykrywawenie anomali i nowości (anomaly detection and novelety detection)

wizualiacja i redukcje wymiarowości

Jak rozróżnić??

Dobry przykładem jest analiza skupień...

analiza_skupien.jpg

źródło: Uczenie maszynowe z użyciem Scikit-Learn i Tensorflow, Aureilen Geron, 2020, Gliwice

lub wykrywanie anomalii:

detekcja%20anomalii.jpg

źródło: Uczenie maszynowe z użyciem Scikit-Learn i Tensorflow, Aureilen Geron, 2020, Gliwice

Oczywiście jest wiele innych rodzajów ,,uczenia" maszynowego:

In [ ]:
 
  • Uczenie przez wzmacnianie (reinforecment learning):

System uczącyc (zwany agentem) obserwuje środowisko i na tej podstawie wykonuje pewne czynności, a take odbiera nagrody lub kary

uczenie_wzmacninia.jpg

źródło: Uczenie maszynowe z użyciem Scikit-Learn i Tensorflow, Aureilen Geron, 2020, Gliwice

Uczenie wsadowe:

Do nauko rozpoznawanie (klasyfikacji) wykorzystywane są wszystkie dostępne dane. System nie jest w stanie trenować przyrostowo, do jego nauki poświęca się dużej ilości czasu i zasobów.

In [ ]:
 

Uczenie przyrostowe:

System jest trenowanyna bieżąco poprzez sekwencyjnie dostarczane dane, któremogą być pojedyncze lub przyjmować postać minipakietów (niewielkich zbiorów)

Uczenie z modelu: wykorzystanie modelu

In [ ]:
 

Załóżmy, że pieniądze dają szczęście...

In [5]:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import sklearn.linear_model
In [7]:
oecd_bli = pd.read_csv("oecd_bli_2015.csv", thousands=',')
oecd_bli = oecd_bli[oecd_bli["INEQUALITY"]=="TOT"]
oecd_bli = oecd_bli.pivot(index="Country", columns="Indicator", values="Value")
oecd_bli.head(5)
Out[7]:
Indicator Air pollution Assault rate Consultation on rule-making Dwellings without basic facilities Educational attainment Employees working very long hours Employment rate Homicide rate Household net adjusted disposable income Household net financial wealth ... Long-term unemployment rate Personal earnings Quality of support network Rooms per person Self-reported health Student skills Time devoted to leisure and personal care Voter turnout Water quality Years in education
Country
Australia 13.0 2.1 10.5 1.1 76.0 14.02 72.0 0.8 31588.0 47657.0 ... 1.08 50449.0 92.0 2.3 85.0 512.0 14.41 93.0 91.0 19.4
Austria 27.0 3.4 7.1 1.0 83.0 7.61 72.0 0.4 31173.0 49887.0 ... 1.19 45199.0 89.0 1.6 69.0 500.0 14.46 75.0 94.0 17.0
Belgium 21.0 6.6 4.5 2.0 72.0 4.57 62.0 1.1 28307.0 83876.0 ... 3.88 48082.0 94.0 2.2 74.0 509.0 15.71 89.0 87.0 18.9
Brazil 18.0 7.9 4.0 6.7 45.0 10.41 67.0 25.5 11664.0 6844.0 ... 1.97 17177.0 90.0 1.6 69.0 402.0 14.97 79.0 72.0 16.3
Canada 15.0 1.3 10.5 0.2 89.0 3.94 72.0 1.5 29365.0 67913.0 ... 0.90 46911.0 92.0 2.5 89.0 522.0 14.25 61.0 91.0 17.2

5 rows × 24 columns

In [8]:
oecd_bli.rename(columns={"Life satisfaction": "Satysfakcja z życia"}, inplace=True)
oecd_bli["Satysfakcja z życia"].head()
Out[8]:
Country
Australia    7.3
Austria      6.9
Belgium      6.9
Brazil       7.0
Canada       7.3
Name: Satysfakcja z życia, dtype: float64
In [10]:
gdp_per_capita = pd.read_csv("gdp_per_capita.csv", thousands=',', delimiter='\t',
                             encoding='latin1', na_values="n/a")
gdp_per_capita.rename(columns={"2015": "PKB per capita"}, inplace=True)
gdp_per_capita.set_index("Country", inplace=True)
gdp_per_capita.head(2)
Out[10]:
Subject Descriptor Units Scale Country/Series-specific Notes PKB per capita Estimates Start After
Country
Afghanistan Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 599.994 2013.0
Albania Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 3995.383 2010.0
In [11]:
full_country_stats = pd.merge(left=oecd_bli, right=gdp_per_capita, left_index=True, right_index=True)
full_country_stats.sort_values(by="PKB per capita", inplace=True)
full_country_stats
Out[11]:
Air pollution Assault rate Consultation on rule-making Dwellings without basic facilities Educational attainment Employees working very long hours Employment rate Homicide rate Household net adjusted disposable income Household net financial wealth ... Time devoted to leisure and personal care Voter turnout Water quality Years in education Subject Descriptor Units Scale Country/Series-specific Notes PKB per capita Estimates Start After
Country
Brazil 18.0 7.9 4.0 6.7 45.0 10.41 67.0 25.5 11664.0 6844.0 ... 14.97 79.0 72.0 16.3 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 8669.998 2014.0
Mexico 30.0 12.8 9.0 4.2 37.0 28.83 61.0 23.4 13085.0 9056.0 ... 13.89 63.0 67.0 14.4 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 9009.280 2015.0
Russia 15.0 3.8 2.5 15.1 94.0 0.16 69.0 12.8 19292.0 3412.0 ... 14.97 65.0 56.0 16.0 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 9054.914 2015.0
Turkey 35.0 5.0 5.5 12.7 34.0 40.86 50.0 1.2 14095.0 3251.0 ... 13.42 88.0 62.0 16.4 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 9437.372 2013.0
Hungary 15.0 3.6 7.9 4.8 82.0 3.19 58.0 1.3 15442.0 13277.0 ... 15.04 62.0 77.0 17.6 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 12239.894 2015.0
Poland 33.0 1.4 10.8 3.2 90.0 7.41 60.0 0.9 17852.0 10919.0 ... 14.20 55.0 79.0 18.4 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 12495.334 2014.0
Chile 46.0 6.9 2.0 9.4 57.0 15.42 62.0 4.4 14533.0 17733.0 ... 14.41 49.0 73.0 16.5 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 13340.905 2014.0
Slovak Republic 13.0 3.0 6.6 0.6 92.0 7.02 60.0 1.2 17503.0 8663.0 ... 14.99 59.0 81.0 16.3 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 15991.736 2015.0
Czech Republic 16.0 2.8 6.8 0.9 92.0 6.98 68.0 0.8 18404.0 17299.0 ... 14.98 59.0 85.0 18.1 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 17256.918 2015.0
Estonia 9.0 5.5 3.3 8.1 90.0 3.30 68.0 4.8 15167.0 7680.0 ... 14.90 64.0 79.0 17.5 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 17288.083 2014.0
Greece 27.0 3.7 6.5 0.7 68.0 6.16 49.0 1.6 18575.0 14579.0 ... 14.91 64.0 69.0 18.6 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 18064.288 2014.0
Portugal 18.0 5.7 6.5 0.9 38.0 9.62 61.0 1.1 20086.0 31245.0 ... 14.95 58.0 86.0 17.6 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 19121.592 2014.0
Slovenia 26.0 3.9 10.3 0.5 85.0 5.63 63.0 0.4 19326.0 18465.0 ... 14.62 52.0 88.0 18.4 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 20732.482 2015.0
Spain 24.0 4.2 7.3 0.1 55.0 5.89 56.0 0.6 22477.0 24774.0 ... 16.06 69.0 71.0 17.6 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 25864.721 2014.0
Korea 30.0 2.1 10.4 4.2 82.0 18.72 64.0 1.1 19510.0 29091.0 ... 14.63 76.0 78.0 17.5 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 27195.197 2014.0
Italy 21.0 4.7 5.0 1.1 57.0 3.66 56.0 0.7 25166.0 54987.0 ... 14.98 75.0 71.0 16.8 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 29866.581 2015.0
Japan 24.0 1.4 7.3 6.4 94.0 22.26 72.0 0.3 26111.0 86764.0 ... 14.93 53.0 85.0 16.3 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 32485.545 2015.0
Israel 21.0 6.4 2.5 3.7 85.0 16.03 67.0 2.3 22104.0 52933.0 ... 14.48 68.0 68.0 15.8 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 35343.336 2015.0
New Zealand 11.0 2.2 10.3 0.2 74.0 13.87 73.0 1.2 23815.0 28290.0 ... 14.87 77.0 89.0 18.1 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 37044.891 2015.0
France 12.0 5.0 3.5 0.5 73.0 8.15 64.0 0.6 28799.0 48741.0 ... 15.33 80.0 82.0 16.4 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 37675.006 2015.0
Belgium 21.0 6.6 4.5 2.0 72.0 4.57 62.0 1.1 28307.0 83876.0 ... 15.71 89.0 87.0 18.9 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 40106.632 2014.0
Germany 16.0 3.6 4.5 0.1 86.0 5.25 73.0 0.5 31252.0 50394.0 ... 15.31 72.0 95.0 18.2 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 40996.511 2014.0
Finland 15.0 2.4 9.0 0.6 85.0 3.58 69.0 1.4 27927.0 18761.0 ... 14.89 69.0 94.0 19.7 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 41973.988 2014.0
Canada 15.0 1.3 10.5 0.2 89.0 3.94 72.0 1.5 29365.0 67913.0 ... 14.25 61.0 91.0 17.2 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 43331.961 2015.0
Netherlands 30.0 4.9 6.1 0.0 73.0 0.45 74.0 0.9 27888.0 77961.0 ... 15.44 75.0 92.0 18.7 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 43603.115 2014.0
Austria 27.0 3.4 7.1 1.0 83.0 7.61 72.0 0.4 31173.0 49887.0 ... 14.46 75.0 94.0 17.0 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 43724.031 2015.0
United Kingdom 13.0 1.9 11.5 0.2 78.0 12.70 71.0 0.3 27029.0 60778.0 ... 14.83 66.0 88.0 16.4 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 43770.688 2015.0
Sweden 10.0 5.1 10.9 0.0 88.0 1.13 74.0 0.7 29185.0 60328.0 ... 15.11 86.0 95.0 19.3 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 49866.266 2014.0
Iceland 18.0 2.7 5.1 0.4 71.0 12.25 82.0 0.3 23965.0 43045.0 ... 14.61 81.0 97.0 19.8 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 50854.583 2014.0
Australia 13.0 2.1 10.5 1.1 76.0 14.02 72.0 0.8 31588.0 47657.0 ... 14.41 93.0 91.0 19.4 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 50961.865 2014.0
Ireland 13.0 2.6 9.0 0.2 75.0 4.20 60.0 0.8 23917.0 31580.0 ... 15.19 70.0 80.0 17.6 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 51350.744 2014.0
Denmark 15.0 3.9 7.0 0.9 78.0 2.03 73.0 0.3 26491.0 44488.0 ... 16.06 88.0 94.0 19.4 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 52114.165 2015.0
United States 18.0 1.5 8.3 0.1 89.0 11.30 67.0 5.2 41355.0 145769.0 ... 14.27 68.0 85.0 17.2 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 55805.204 2015.0
Norway 16.0 3.3 8.1 0.3 82.0 2.82 75.0 0.6 33492.0 8797.0 ... 15.56 78.0 94.0 17.9 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 74822.106 2015.0
Switzerland 20.0 4.2 8.4 0.0 86.0 6.72 80.0 0.5 33491.0 108823.0 ... 14.98 49.0 96.0 17.3 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 80675.308 2015.0
Luxembourg 12.0 4.3 6.0 0.1 78.0 3.47 66.0 0.4 38951.0 61765.0 ... 15.12 91.0 86.0 15.1 Gross domestic product per capita, current prices U.S. dollars Units See notes for: Gross domestic product, curren... 101994.093 2014.0

36 rows × 30 columns

In [12]:
full_country_stats[["PKB per capita", 'Satysfakcja z życia']].loc["United States"]
Out[12]:
PKB per capita         55805.204
Satysfakcja z życia        7.200
Name: United States, dtype: float64
In [14]:
remove_indices = [0, 1, 6, 8, 33, 34, 35]
keep_indices = list(set(range(36)) - set(remove_indices))

sample_data = full_country_stats[["PKB per capita", 'Satysfakcja z życia']].iloc[keep_indices]
missing_data = full_country_stats[["PKB per capita", 'Satysfakcja z życia']].iloc[remove_indices]
In [15]:
sample_data.plot(kind='scatter', x="PKB per capita", y='Satysfakcja z życia', figsize=(5,3))
plt.axis([0, 60000, 0, 10])
position_text = {
    "Hungary": (5000, 1),
    "Korea": (18000, 1.7),
    "France": (29000, 2.4),
    "Australia": (40000, 3.0),
    "United States": (52000, 3.8),
}
for country, pos_text in position_text.items():
    pos_data_x, pos_data_y = sample_data.loc[country]
    country = "USA" if country == "United States" else country
    country = "Węgry" if country == "Hungary" else country
    country = "Francja" if country == "France" else country
    plt.annotate(country, xy=(pos_data_x, pos_data_y), xytext=pos_text,
            arrowprops=dict(facecolor='black', width=0.5, shrink=0.1, headwidth=5))
    plt.plot(pos_data_x, pos_data_y, "ro")
plt.xlabel("PKB per capita (dolary)")
#save_fig('r_1_17')
plt.show()

Czy ta zależność układa się podług linii prostej?

liniowy_jakosc_zycia.jpg

Ale jak te współczynniki dobrać?

wsp_model_liniowy.png

Uczenie i uruchamianie modelu liniowego za pomocÄ… biblioteki Scikit-Learn:

In [20]:
def prepare_country_stats(oecd_bli, gdp_per_capita):
    oecd_bli = oecd_bli[oecd_bli["INEQUALITY"]=="TOT"]
    oecd_bli = oecd_bli.pivot(index="Country", columns="Indicator", values="Value")
    gdp_per_capita.rename(columns={"2015": "GDP per capita"}, inplace=True)
    gdp_per_capita.set_index("Country", inplace=True)
    full_country_stats = pd.merge(left=oecd_bli, right=gdp_per_capita,
                                  left_index=True, right_index=True)
    full_country_stats.sort_values(by="GDP per capita", inplace=True)
    remove_indices = [0, 1, 6, 8, 33, 34, 35]
    keep_indices = list(set(range(36)) - set(remove_indices))
    return full_country_stats[["GDP per capita", 'Life satisfaction']].iloc[keep_indices]
In [21]:
# Importujemy moduły:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import sklearn.linear_model
In [22]:
# Wczytuje dane
oecd_bli = pd.read_csv("oecd_bli_2015.csv", thousands=',')
gdp_per_capita = pd.read_csv("gdp_per_capita.csv",thousands=',',delimiter='\t',
                             encoding='latin1', na_values="n/a")
In [23]:
# Przygotowuje dane
country_stats = prepare_country_stats(oecd_bli, gdp_per_capita)
X = np.c_[country_stats["GDP per capita"]]
y = np.c_[country_stats["Life satisfaction"]]

country_stats.rename(columns={"GDP per capita": "PKB per capita"}, inplace=True)
country_stats.rename(columns={"Life satisfaction": "Satysfakcja z życia"}, inplace=True)
In [24]:
# Wizualizuje dane
country_stats.plot(kind='scatter', x="PKB per capita", y='Satysfakcja z życia')
plt.show()
In [25]:
# Wybiera model liniowy
model = sklearn.linear_model.LinearRegression()
In [26]:
# Uczy dane
model.fit(X, y)
Out[26]:
LinearRegression()
In [27]:
# Oblicza prognozy dla Cypru
X_new = [[22587]]  # PKB per capita Cypru
print(model.predict(X_new)) 
[[5.96242338]]
In [30]:
from sklearn import linear_model
lin1 = linear_model.LinearRegression()
Xsample = np.c_[sample_data["PKB per capita"]]
ysample = np.c_[sample_data["Satysfakcja z życia"]]
lin1.fit(Xsample, ysample)
t0, t1 = lin1.intercept_[0], lin1.coef_[0][0]
t0, t1
sample_data.plot(kind='scatter', x="PKB per capita", y='Satysfakcja z życia', figsize=(5,3))
plt.xlabel("PKB per capita (dolary)")
plt.axis([0, 60000, 0, 10])
X=np.linspace(0, 60000, 1000)
plt.plot(X, t0 + t1*X, "b")
plt.text(5000, 3.1, r"$\theta_0 = 4.85$", fontsize=14, color="b")
plt.text(5000, 2.2, r"$\theta_1 = 4.91 \times 10^{-5}$", fontsize=14, color="b")
#save_fig('r_1_19')
plt.show()
print("t1 = ", t1)
print("t0 = ", t0)
t1 =  4.911544589158484e-05
t0 =  4.853052800266436

Główne problemy uczenia maszynowgo

In [ ]:
 
  • Niedorzeczna efektywność danych:

Problem uczenia: ,,zły algorytm" lub ,,złe dane". Przykładem może być kompromis pomiędzy wkładanym wysiłmiem w rozwój algorytmów, a stworzenie zbiorów danych (korpusy językowe: ,,buk", ,,Bug", ,,Bóg", ,,Buk")

  • Niedobór danych uczÄ…cych

Aby algorytmy uczenia maszynowego działały poprawnie, niezbędne jest zapewnienie mnóstwa danych. Algorytmy związane z przetwarzaniem tekstu

  • Niereprezentatywne dane uczÄ…ce

Aby proces trenowania modelu przebigał skutecznie, dane muszą być dobrane w sposób adekwatny aby "generalizacja" jaka zostanie wykonana przez algorytm nie odbiegała od modelu

niereprezentatywne%20dane.png

dane związane z krajami,pkb nie był doskonale reprezentatywny dla modelu liniowego, brakuje w nim kilku państw. Model wyuczonym przy pomocy dodanych nowych państw: linia ciągła, Stary model: linia przerywana

  • Dane kiepskiej jakoÅ›ci

jeśli niektóre elementy wyraźnie odstają od reszty przykładów, wystarczy je odrzucić

jeśli miektórym przykładom brakuje kilku cech, ( np klient nie podał wieku), należy zadecydować czy wytrenować wskazaując w tę lukę wartość średnią, wytrenować model z tą wartością, a drugi bez niej.

  • Przetrewnowanie danych uczÄ…cych: overfiting

nadmierna generalizacja lub też przetrenowanie lub nadmierne dopasowanie

Model dobrze sprawdza się dla danych uczących, ale sam proces uogólniania nie sprawuje się zbyt dobrze

przetrenowanie_danych_ucz%C4%85cych.png

In [ ]: